﻿<%@ Page Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<dynamic>"%>
<%@ Import Namespace="yibo.Models" %>

<asp:Content ID="EditArticleTitle" ContentPlaceHolderID="TitleContent" runat="server">
    edit article
</asp:Content>
<asp:Content ID="EditArticleContent" ContentPlaceHolderID="MainContent" runat="server">
    <script type="text/javascript" src="../../Scripts/CKEditor/ckeditor.js"></script>
    <%
        int index = (int)ViewData["articleIndex"];
        article myArticle = new article();
        if (Session["articleList"] != null && index >= 0)
        {
            myArticle = ((IQueryable<article>)Session["articleList"]).ToList()[index];
        }
    %>

    <%using (Html.BeginForm("ShowArticle", "MyArticles", FormMethod.Post)){%>
    <table style="width:100%;">
        <tr>
            <td class="style1" colspan="2" style="font-size: xx-large">
                <strong>发博文：</strong></td>
            <td class="style9">
                &nbsp;</td>
        </tr>
        <tr>
            <td class="style7" colspan="2">
                <strong>
                <br />
                标题：</strong></td>
            <td>
                <strong></strong></td>
        </tr>
        <tr>
            <td class="style7" colspan="2">
                <input id="Hidden1" type="hidden" />
                <input id="Text1" name="Text1" type="text" style="width: 380px" value="<%=myArticle.title%>">
            </td>
            <td>
                <select id="Select1" name="D4">
                    <option>所有人可见</option>
                    <option>仅自己可见</option>
                </select></td>
        </tr>
        <tr>
            <td class="style7" colspan="2">
                <strong>关联商品：</strong>
                <script src="../../Scripts/mooflow/MooFlow/MooFlow.js" type="text/javascript"></script>
                <script src="../../Scripts/mooflow/mootools-1.2-core.js" type="text/javascript"></script>
                <script src="../../Scripts/mooflow/mootools-1.2-more.js" type="text/javascript"></script>
                <script type="text/javascript">
                    var myMooFlowPage = {
                        start: function () {
                            /* MooFlow instance with the complete UI and dbllick-callback */
                            var mf = new MooFlow($('MooFlow'), {
                                useSlider: true,
                                useAutoPlay: true,
                                useCaption: true,
                                useResize: true,
                                useMouseWheel: true,
                                useKeyInput: true,
                                useWindowResize: true,
                                heightRatio: 0.3,
                                offsetY: -200,
                                bgColor: '#FFF',
                                'onClickView': function (mixedObject) {
                                    myMooFlowPage.log(JSON.encode(mixedObject));
                                }
                            });
                        },
                        log: function (result) {
                            new Element('p', { html: result }).inject($('callback'), 'top');
                        }
                    };

                    window.addEvent('domready', myMooFlowPage.start);
                </script>
<%--                <div id="content">
                  <div id="MooFlow">
                    <div><img src="../../Scripts/mooflow/img/1.jpg" title="1" alt="1"  /></div>
                    <div><img src="../../Scripts/mooflow/img/2.jpg" title="2" alt="2"  /></div>
                    <div><img src="../../Scripts/mooflow/img/3.jpg" title="3" alt="3"  /></div>
                    <div><img src="../../Scripts/mooflow/img/4.jpg" title="4" alt="4"  /></div>
                  </div>
                  <div id="callback"></div>
                </div>--%>
                <br />
                <select id="Select3" name="D3" style="height: 30px; width: 323px">
                    <option></option>
                </select>
                <input id="Button5" type="button" value="NEW" /><br />
                </td>
            <td>
                <select id="Select4" name="D5">
                    <option>允许所有人评论</option>
                    <option>不允许评论</option>
                </select></td>
        </tr>
        <tr>
            <td class="style8" colspan="2">
                <strong>内容：</strong></td>
            <td>
                <select id="Select5" name="D6">
                    <option>选择分类</option>
                    <option>原创随感</option>
                    <option>手工艺品</option>
                </select></td>
        </tr>
        <tr>
            <td rowspan="2" colspan="2">
                <%=Html.TextArea("TextArea1",myArticle.articleContent)%>
                <script type="text/javascript">
                    CKEDITOR.replace('TextArea1');
                </script></td>
            <td style="height: 56px">
                <textarea id="TextArea2" name="S2">添加标签，用逗号或回车分隔</textarea></td>
        </tr>
        <tr>
            <td>
                <input id="Checkbox1" type="checkbox" /><strong><span class="style6">文章置顶</span></strong></td>
        </tr>
        <tr>
            <td style="text-align: right" colspan="2">
                告诉朋友自己在这里发博文咯~！-->
                <script src="../../Scripts/Share/qzoneShare.js" type="text/javascript"></script>
                <script src="../../Scripts/Share/weibo.js" type="text/javascript"></script>
                <script src="../../Scripts/Share/renren.js" type="text/javascript"></script>
                <script type="text/javascript">                    qzoneShare();</script>
                <script type="text/javascript">                    weibo();</script>
                <script type="text/javascript">                    renren();</script></td>
            <td>
                &nbsp;</td>
        </tr>
        <tr>
            <td style="text-align: left">
                <input id="Button11" onclick="javascript:window.location.href='/MyArticles/ArticlesList'" type="button" value="取消" /></td>
            <td style="text-align: right">
                <input id="Button12" type="button" value="保存草稿" />&nbsp;
                <input id="Button9" onclick="javascript:window.location.href='/MyArticles/ShowArticle'" type="submit" value="预览"/>
                <input id="Button10" onclick="javascript:window.location.href='/MyArticles/InsertArticle'" type="button" value="发布" /></td>
            <td>
                &nbsp;</td>
        </tr>
        <tr>
            <td class="style11">
                &nbsp;</td>
            <td class="style10">
                &nbsp;</td>
        </tr>
    </table>
    <%Html.EndForm();}%>
</asp:Content>
